package org.nstack.header.volume;

import org.nstack.header.message.APIMessage;
import org.nstack.header.message.APIParam;
import org.springframework.http.HttpMethod;
import org.nstack.header.identity.Action;
import org.nstack.header.vm.VmInstanceVO;
import org.nstack.header.rest.RestRequest;


@Action(category = VolumeConstant.ACTION_CATEGORY)
@RestRequest(
        path = "/volumes/{uuid}/vm-instances",
        method = HttpMethod.DELETE,
        responseClass = APIDetachDataVolumeFromVmEvent.class
)
public class APIDetachDataVolumeFromVmMsg extends APIMessage implements VolumeMessage {

    @APIParam(resourceType = VolumeVO.class, checkAccount = true, operationTarget = true)
    private String uuid;
    @APIParam(required = false, resourceType = VmInstanceVO.class, checkAccount = true, operationTarget = true)
    private String vmUuid;

    public String getVmUuid() {
        return vmUuid;
    }

    public void setVmUuid(String vmUuid) {
        this.vmUuid = vmUuid;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String volumeUuid) {
        this.uuid = volumeUuid;
    }

    @Override
    public String getVolumeUuid() {
        return uuid;
    }
 
    public static APIDetachDataVolumeFromVmMsg __example__() {
        APIDetachDataVolumeFromVmMsg msg = new APIDetachDataVolumeFromVmMsg();
        msg.setUuid(uuid());
        msg.setVmUuid(uuid());

        return msg;
    }

}
